/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lucava.boatskeeper.client.presenter;

import com.google.gwt.user.client.ui.HasWidgets;
import net.customware.gwt.dispatch.client.DispatchAsync;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.widget.WidgetDisplay;
import net.customware.gwt.presenter.client.widget.WidgetPresenter;

/**
 *
 * @author glenn
 */
public abstract class ViewPresenter<D extends WidgetDisplay> extends WidgetPresenter<D> {

    
    private final DispatchAsync dispatcher;

    public ViewPresenter(DispatchAsync dispather, EventBus eventBus, D display) {
        super(display, eventBus);
        this.dispatcher = dispather;
    }

    public void go(HasWidgets container) {
        container.clear();
        container.add(display.asWidget());

    }

    public DispatchAsync getDispatcher() {
        return dispatcher;
    }

    

    @Override
    protected void onUnbind() {
        this.unbind();
    }

    @Override
    public void revealDisplay() {
        // TODO Auto-generated method stub
    }
}